package com.paradogs.framework.core.msg;

import lombok.Data;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.time.LocalDateTime;

/**
 * @author: yumi
 * @date: 2023/7/28  22:50
 * @Description: DB 线程异步数据更新任务
 */
@Data
public class DBTask {

    /**
     * 操作类
     */
    private Object operateObj;

    /**
     * 调用方法
     */
    private Method callMethod;

    /**
     * 调用参数
     */
    private Object[] params;

    /**
     * 任务发起时间
     */
    private LocalDateTime startTime;

    public void call() throws InvocationTargetException, IllegalAccessException {
        callMethod.invoke(operateObj, params);
    }

}
